<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 用户职业生涯信息表
 *
 * Date: 19/03/2018
 * @author George
 */
class CreateCareersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('careers', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->index()->comment('用户ID');
            $table->unsignedInteger('company_id')->comment('公司ID');
            $table->unsignedInteger('project_id')->comment('项目ID');
            $table->unsignedInteger('company_name')->comment('公司名称');
            $table->unsignedInteger('project_name')->comment('项目名称');
            $table->string('position')->comment('岗位');
            $table->unsignedTinyInteger('grade')->default(5)->comment('评分');
			$table->date('entry')->comment('入职时间');
			$table->date('dimission')->comment('离职时间');
			$table->string('comment')->nullable()->comment('公司评价');
			$table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('careers');
    }
}
